var vm = new Vue({
    el: '#app',
    delimiters: ['[[', ']]'],
    data: {
        student: "1",
        sub_list: [

        ]
    },
   mounted(){
        this.get_category_data()

    },
    methods: {
        get_category_data:function(){
            var url = 'http://127.0.0.1:8000/sub/';
            axios.get(url, {
                responseType: 'json',
            })
                .then(response => {
                    this.sub_list = response.data.data

                    this.student = {
                                "age": 18,
                                "id": 1,
                                "name": "\u5f20\u4e09",
                                "snum": 100,
                                "sub": {
                                  "id": 1,
                                  "name": "\u8ba1\u7b97\u673a\u5e94\u7528"
                                },
                                "sub_id": 2
                              }
                              this.$set(this.student, "sub_id", 2)
                              console.log(this.student.sub_id)
                })
                .catch(error => {
                    console.log(error.response);
                })
        },
    }

    });